package com.vrv.app.cyberspace.modules.sys.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.vrv.app.cyberspace.common.utils.JSONResult;
import com.vrv.app.cyberspace.modules.sys.entity.OrganizeTable;
import com.vrv.app.cyberspace.modules.sys.service.IOrganizeTableService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.vrv.app.cyberspace.common.utils.JSONResult.renderSuccess;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author sm
 * @since 2017-12-28
 */
@RestController
@RequestMapping("/sys/organizeTable")
@Api(description = "组织架构接口")
public class OrganizeTableController extends BaseController {

    @Autowired
    private IOrganizeTableService iOrganizeTableService;

    /**
     * 获取组织信息
     */
    @RequestMapping("/list")
    public JSONResult getListRegion(Integer orgID) {
        return renderSuccess(iOrganizeTableService.selectList(new EntityWrapper<OrganizeTable>().eq("parentOrgID",orgID)));
    }


    /**
     * 值班员 获取 网信办
     */
    @RequestMapping("/off")
    @ApiOperation("值班员 获取 网信办")
    public JSONResult listOffices(Integer id) {
        return iOrganizeTableService.listOffices(id);
    }

    /**
     * 网信办 获取 运营单位
     */
    @RequestMapping("/listOperators")
    public JSONResult listOperators(Integer orgID) {
        return iOrganizeTableService.listOperators(orgID);
    }

    /**
     * 获取 每日零报告下发的组织
     */
    @RequestMapping("/dailyOrgs")
    public JSONResult dailyOrgs() {
        return iOrganizeTableService.dailyOrgs();
    }
}





